package com.buyinglist.app.facade;

import java.util.LinkedList;
import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.buyinglist.app.DAO.UserDAO;
import com.buyinglist.app.domain.User;
import com.buyinglist.app.view.UserView;

public class UserFacade {

	private UserDAO userDAO;
	private static final Logger logger = LoggerFactory.getLogger(GeoFacade.class);
	
	public void setUserDAO(UserDAO userDAO) {
		this.userDAO = userDAO;
	}

	public List<UserView> findUserIdLogin(String login){
		logger.info("UserFacade. Start findUserIdLogin");
		List<User> cList=userDAO.findUserIdLogin(login);
		List<UserView> cvList=new LinkedList<UserView>();
		for (User u : cList){
			cvList.add(new UserView(u));
		}
		return cvList;
	}
}
